@namespace SwashbucklerDiary.Rcl.Pages
@inherits DialogComponentBase

<MultiDisplay>
    <MobileContent>
        <CustomMBottomSheet MyValue="Visible"
                               MyValueChanged="InternalVisibleChanged"
                               ContentClass="rounded-t-lg">
            <MCard Class="rounded-t-lg py-2">
                <MList>
                    <div class="dynamic-list-item-collection">
                        @foreach (var item in items)
                        {
                            <MListItem OnClick="@item.OnClick">
                                <MListItemIcon>
                                    <MIcon>@item.Icon</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    @(I18n.T(item.Text))
                                </MListItemContent>
                                <MListItemAction>
                                    @if (Value.Contains(item.Value))
                                    {
                                        <MIcon>
                                            mdi-check
                                        </MIcon>
                                    }
                                </MListItemAction>
                            </MListItem>

                            <MDivider></MDivider>
                        }
                    </div>
                    <MListItem>
                        <MButton Rounded="true"
                                 Block="true"
                                 Depressed="true"
                                 Large="true"
                                 Class="text-subtitle-1"
                                 OnClick="HandleOnCancel">
                            @(I18n.T("Share.Cancel"))
                        </MButton>
                    </MListItem>
                </MList>
            </MCard>
        </CustomMBottomSheet>
    </MobileContent>
    <DesktopContent>
        <CustomMDialog MyValue="Visible"
                          MyValueChanged="InternalVisibleChanged"
                          ContentClass="rounded-lg"
                          MaxWidth="420">
            <MCard>
                <MCardTitle Class="font-weight-bold">
                    @(I18n.T("SelectFileTypes"))
                    <MSpacer></MSpacer>
                    <MButton Icon="true"
                             OnClick="HandleOnCancel">
                        <MIcon>mdi-close</MIcon>
                    </MButton>
                </MCardTitle>
                <MCardText>
                    @foreach (var item in items)
                    {
                        <MListItem Class="px-0"
                                   OnClick="@item.OnClick">
                            <MListItemIcon Class="my-3">
                                <MIcon Class="evident-icon">
                                    @(item.Icon)
                                </MIcon>
                            </MListItemIcon>
                            <MListItemContent>
                                <MListItemTitle>
                                    @(I18n.T(item.Text))
                                </MListItemTitle>
                            </MListItemContent>
                            <MListItemAction>
                                @if (Value.Contains(item.Value))
                                {
                                    <MIcon>
                                        mdi-check
                                    </MIcon>
                                }
                            </MListItemAction>
                        </MListItem>
                    }
                </MCardText>
            </MCard>
        </CustomMDialog>
    </DesktopContent>
</MultiDisplay>
